package cn.bon.common.tool;

public class UserContext {
    private static final ThreadLocal<String> tl = new ThreadLocal<>();

    /**
     * 设置用户的token
     * @param tk
     */
    public static void setUser(String tk) {
        tl.set(tk);
    }

    /**
     * 获取用户的token
     * @return
     */
    public static String getUser() {
        return tl.get();
    }

    /**
     * 移除当前登录用户token
     */
    public static void removeUser(){
        tl.remove();
    }
}
